package team.southcat.wsyygh.common.util;

import javax.servlet.http.HttpServletRequest;

/**
 * 获取管理员信息工具类
 */
public class AdminInfoUtil {

    //获取当前管理员id
    public static String getAdminId(HttpServletRequest request) {
        //从header获取token
        String token = request.getHeader("hospitalToken");
        if (token == null){
            token = request.getHeader("HospitalToken");
        }
        if (token == null){
            return null;
        }
        //jwt从token获取userid
        String adminId = JwtUtil.getUserId(token);
        return adminId;
    }

}
